package lc_2656_K_个元素的最大和;

import java.util.Arrays;

public class Solution {

    public int maximizeSum(int[] nums, int k) {
        int max = Arrays.stream(nums).max().getAsInt();
        return max * k + (k - 1) * k / 2;
    }
}